import time
def sort(file_name):
    t = time.time()
    b = []
    with open(file_name) as f:
        for line in f:
            b.append([int(i)for i in line.split()])
    for i in range(len(b)):
        for j in range(0,len(b)-1):
            if b[j] > b[j +1]:
                b[j], b[j + 1] = b[j + 1],b[j]
    t2 = time.time()
    print(b)
    print("Time sorted by:",t2-t)
print("Array1")
sort('m1_sorted.txt')
print("Array 2\n")
sort('m2_reverse.txt')
print("Array 3\n")
sort ('m3_shuffle.txt')
    
